package com.distributeredis.redis_springboot.springeasyexcel.vo.Excel样式;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*;
import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.apache.poi.ss.usermodel.FillPatternType;

import java.util.Date;

import static com.alibaba.excel.enums.poi.FillPatternTypeEnum.SOLID_FOREGROUND;

// 注意范围  IndexedColors 枚举类
// 头背景设置成红色 IndexedColors.RED.getIndex()
@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND,fillForegroundColor = 10)
// 头字体设置成20
@HeadFontStyle(fontHeightInPoints = 20)
// 内容的背景设置成绿色 IndexedColors.GREEN.getIndex()
@ContentStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND,fillForegroundColor = 17)
// 内容字体设置成20
@ContentFontStyle(fontHeightInPoints = 20)
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
// 设置内容高度
@ContentRowHeight(30)
// 设置内容宽度
@ColumnWidth(50)
public class DemoStyleData {
    // 字符串的头背景设置成粉色，IndexedColors.PINK.getIndex()
    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND,fillForegroundColor = 14)
// 头字体设置成20
    @HeadFontStyle(fontHeightInPoints = 30)
// 内容的背景设置成天蓝色 IndexedColors.GREEN.getIndex()
    @ContentStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND,fillForegroundColor = 40)
// 内容字体设置成20
    @ContentFontStyle(fontHeightInPoints = 30)
    @ExcelProperty("字符串标题")
    private String string;


    @ExcelProperty("日期标题")
    private Date date;
    @ExcelProperty("数字标题")
    private Double doubleData;

}
